/*
 * @(#)GlobalConstant.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.framework;

/**
  GlobalConstant.java

  This class is to store all global constants which used in systems.

    @author          Rollo Chan
    @company         DCIVision Limited
    @creation date   24/06/2003
    @version         $Revision: 1.89.4.13 $
*/

public class GlobalConstant {

  public static final String REVISION = "$Revision: 1.89.4.13 $";

  private GlobalConstant() {
  }

  /****************************************************************************
   * The key of attributes common used in the system.
   ****************************************************************************/

  /** The key which used to retrieve the ApplicationContainer in application scope. */
  public final static String APPLICATION_CONTAINER_KEY = "applicationContainer";

  /** The key which used to retrieve the SessionContainer in session scope. */
  public final static String SESSION_CONTAINER_KEY = "sessionContainer";

  /** The key which used to retrieve the client screen width in session scope. */
  public final static String CLIENT_SCREEN_WIDTH_KEY = "CLIENT_SCREEN_WIDTH_KEY";

  /** The key which used to retrieve the context path in application scope. */
  public final static String CONTEXT_PATH_KEY = "CONTEXT_PATH";

  /** The key which used to retrieve the dynamic class loader in application scope. */
  public final static String CLASS_LOADER_KEY = "DYN_CLASS_LOADER";

  /** The key which used to retrieve the full text index factory in application scope. */
  public final static String FULL_TEXT_KEY = "FULL_TEXT_FACTORY_KEY";

  /** The key which used to retrieve the DB Connection in request scope. */
  public final static String DB_KEY = "DB_KEY";

 /** The key which used to retrieve the DAO in request scope. */
  public final static String DAO_KEY = "DAO_KEY";

  /** The key which used to retrieve the function code in request scope. */
  public final static String FUNCTION_CODE_KEY = "FUNCTION_CODE";

  /** The request parameter used to changed the locale. */
  public final static String LANGUAGE_PARAMETER = "LANGUAGE";

  /** The personal preference*/
  public final static String PERSONAL_PREFERENCE = "PREFERENCE";
  
  /** The request parameter used to retrieve the current action mapping information. */
  public final static String ACTION_MODE = "ACTION_MODE";

  /** System property file name */
  public final static String CONFIG_FILENAME = "config";
  
  /** Key for external datasource lookup */
  public final static String EXTERNAL_DATA_SOURCE = "ext_datasource_";
  
  //key for event code lookup
  public final static String EVENT_CODE_KEY = "EVENT_CODE_KEY";
  
  /** The attribute key for next destination URL our controller is related to */
  public final static String NEXT_URL_KEY = "NEXT_URL_KEY";

  /** The attribute key for default page title*/
  public final static String DEFAULT_PAGE_TITLE= "DEFAULT_PAGE_TITLE";
  
  /** The attribute key for extend page path*/
  public final static String EXTEND_PAGE_PATH = "EXTEND_PAGE_PATH";
  
  /** The attribute key for extend page title*/
  public final static String EXTEND_PAGE_TITLE= "EXTEND_PAGE_TITLE";
  
  /** The attribute key for show extend page title only*/
  public static final String EXTEND_PAGE_TITLE_SHOW_ONLY = "ONLY_SHOW_EXTEND_PAGE_TITLE";
  
  /** The attribute key for need show action str in page title*/
  public static final String PAGE_TITLE_NEED_SHOW_ACTION_STR = "NEED_SHOW_ACTION_STR";
  
  /****************************************************************************
   * The navigation modes.
   ****************************************************************************/

  /** Navigation mode representing LIST. */
  public static final String NAV_MODE_LIST = "L";

  /** Navigation mode representing NEW. */
  public static final String NAV_MODE_NEW = "N";

  /** Navigation mode representing EDIT. */
  public static final String NAV_MODE_EDIT = "E";

  /** Navigation mode representing VIEW. */
  public static final String NAV_MODE_VIEW = "V";

  /** Navigation mode representing REFRESH. */
  public static final String NAV_MODE_REFRESH = "R";

  /** Navigation mode representing CHANGE. */
  public static final String NAV_MODE_CHANGE = "C";

  /** Navigation mode representing FREEZE. */
  public static final String NAV_MODE_FREEZE = "F";

  /** Navigation mode representing PREVIEW. */
  public static final String NAV_MODE_PREVIEW = "P";

  // key of delete operation
  public static final String NAV_MODE_DELETE = "D";

  /****************************************************************************
   * The operation modes.
   ****************************************************************************/

  /** Operation mode representing operation avaiable in MAINT for insert. */
  public final static String OP_MODE_INSERT = "INS";

  /** Operation mode representing operation avaiable in MAINT for update. */
  public final static String OP_MODE_UPDATE = "UPD";

  /** Operation mode representing operation avaiable in MAINT for delete. */
  public final static String OP_MODE_DELETE = "DEL";

  /** Operation mode representing operation avaiable in MAINT for refresh. */
  public static final String OP_MODE_REFRESH = "REFRESH";

  /** Operation mode representing operation avaiable in MAINT for copy. */
  public final static String OP_MODE_COPY = "CPY";
  
  /** Operation mode representing operation avaiable in MAINT for move. */
  public final static String OP_MODE_MOVE = "MOV";

  /** Operation mode representing operation avaiable in MAINT for insert and new. */
  public final static String OP_MODE_INSERT_NEW = "INSNEW";

  /** Operation mode representing operation avaiable in MAINT for insert and new. */
  public final static String OP_MODE_UPDATE_NEW = "UPDNEW";

  /** Operation mode representing operation avaiable in LIST for search. */
  public static final String OP_MODE_LIST_SEARCH = "LSRH";

  /** Operation mode representing operation avaiable in LIST for reset search. */
  public static final String OP_MODE_LIST_SEARCH_RESET = "LRST";

  /** Operation mode representing operation avaiable in LIST for deletion. */
  public static final String OP_MODE_LIST_DELETE = "LDEL";

  /** Operation mode representing operation avaiable in LIST for retaining attributes. */
  public static final String OP_MODE_LIST_RETAIN = "LRETAIN";
  
  /** Operation mode representing operation myFavorite. */
  public static final String OP_MODE_MY_FAVORITE = "MYFAVORITE";

  /****************************************************************************
   * The operation modes.
   ****************************************************************************/

  /** The ascending order in LIST sorting */
  public static final String LIST_ACSENDING = "ASC";

  /** The descending order in LIST sorting */
  public static final String LIST_DECSENDING = "DESC";

  /****************************************************************************
   * The locale string representation supported in the system.
   ****************************************************************************/

  /** Locale string representing English. */
  public static final String LOCALE_STR_EN_US = "en_US";

  /** Locale string representing Traditional Chinese. */
  public static final String LOCALE_STR_ZH_HK = "zh_HK";

  /** Locale string representing Traditional Chinese. */
  public static final String LOCALE_STR_ZH_TW = "zh_TW";

  /** Locale string representing Simplified Chinese. */
  public static final String LOCALE_STR_ZH_CN = "zh_CN";

  /****************************************************************************
   * Record status types.
   ****************************************************************************/

  /** Active status of Record Status. */
  public final static String RECORD_STATUS_ACTIVE = "A";

  /** Inctive status of Record Status. */
  public final static String RECORD_STATUS_INACTIVE = "I";

  /** Pending status of Record Status. */
  public final static String RECORD_STATUS_PENDING = "P";
  
  /** Empty status of Record Status. */
  public final static String RECORD_STATUS_EMPTY = "E";

  /****************************************************************************
   * Status types.
   ****************************************************************************/

  /** Status type representing Active. */
  public static final String STATUS_ACTIVE = "A";

  /** Status type representing Inactive. */
  public static final String STATUS_INACTIVE = "I";
  
  /** Status type lock*/
  public static final String STATUS_LOCKED = "X" ;

  /** Status type archive */
  public static final String STATUS_ARCHIVED = "R";

  /** Release status type representing Pending. */
  public static final String RECORD_PENDING = "P";

  /** Release status type representing Released. */
  public static final String RECORD_RELEASED = "R";

  /** Release status type representing Cancelled. */
  public static final String RECORD_CANCELLED = "C";

  /****************************************************************************
   * Object types.
   ****************************************************************************/

  /** Object type representing ALL objects. */
  public static final String OBJECT_TYPE_ALL = "*";

  /** Object type representing Function. */
  public static final String OBJECT_TYPE_FUNCTION = "F";

  /** Object type representing Document. */
  public static final String OBJECT_TYPE_DOCUMENT = "D";

  /** Object type representing Workflow. */
  public static final String OBJECT_TYPE_WORKFLOW = "W";

  /** Object type representing Workflow. */
  public static final String OBJECT_TYPE_CALENDAR = "C";

  /** Object type representing Form. */
  public static final String OBJECT_TYPE_FORM = "M";

  /** Object type representing Form Group. */
  public static final String OBJECT_TYPE_FORMGROUP = "G";

  /** Object type representing UDF. */
  public static final String OBJECT_TYPE_UDF = "U";

  /****************************************************************************
   * Permission types.
   ****************************************************************************/

  /** Permission type representing FULL SET of permission. */
  public static final String PERMISSION_ALL = "A";

  /** Permission type representing ANY of the permission. */
  public static final String PERMISSION_ANY = "*";
  
  /** Permission type document by unfinished workflow of the permission**/
  public static final String PERMISSION_DOCUMENT_BY_UNFINISHED_WORKFLOW ="R";
  
  /** Workflow Owner Permission **/
  public static final String WORKFLOW_OWNER_PERMISSION = "WORKFLOW_OWNER_PERMISSION";

  /****************************************************************************
   * Priority types.
   ****************************************************************************/

  /** Priority type representing HIGH PRIORITY */
  public static final String PRIORITY_HIGH = "2";

  /** Priority type representing HIGH PRIORITY */
  public static final String PRIORITY_MEDIUM = "1";

  /** Priority type representing HIGH PRIORITY */
  public static final String PRIORITY_LOW = "0";

  /****************************************************************************
   * Permission Subject types.
   ****************************************************************************/
  /** Permission subject type representing User. */
  public static final String SUBJECT_TYPE_USER = "U";

  /** Permission subject type representing Group. */
  public static final String SUBJECT_TYPE_GROUP = "G";

  /** Permission subject type representing Role. */
  public static final String SUBJECT_TYPE_ROLE = "R";
  
  /** Permission subject type representing other for WorkFlow. */
  public static final String SUBJECT_TYPE_OTHER = "O";
  
  /****************************************************************************
   * Common constants.
   ****************************************************************************/
  /** Value which represent AND. */
  public static final String AND = "AND";
  
  /** Value which represent ONE. */
  public static final String ONE = "ONE";
  
  /** Value which represent OR. */
  public static final String OR = "OR";
  
  /** Value which represent TRUE. */
  public static final String TRUE = "Y";

  /** Value which represent FALSE. */
  public static final String FALSE = "N";
  
  /** Value which represent Error*/
  public static final String ERROR ="E";
  
  /** Default value if the field retrieved is empty or null */
  public static final String EMPTY_FIELD = "-";
  
  /** Default value if the field retrieved is empty or null */
  public static final String EMPTY_FIELD_SPACE = "";

  /** String representation of NULL value for audit trail. */
  public final static String AUDIT_TRAIL_NULL = "[null]";

  /** Date time format for audit trail. */
  public final static String AUDIT_TRAIL_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";

  /** Document final version number for audit trail. */
  public final static String AUDIT_TRAIL_DMS_FINAL_VERSION_NUM = "999999999";
  
  /** String representing the common Mandatory Class Label. */
  public static final String MANDATORY_LABEL = "formLabelSmallMan";

  /** String representing the common Data Class Label. */
  public static final String DATA_LABEL = "formLabelSmall";

  /** String representing the common property not available. */
  public static final String NOT_AVAILABLE = "NaN";

  /****************************************************************************
   * Personal Home List Type constants.
   ****************************************************************************/

  /** Default value if the field retrieved is empty or null */
  public static final String HOME_CALENDAR_TODO_LIST= "alertCalendarToDoList";
  public static final String HOME_CALENDAR_EVENT_LIST= "alertCalendarEventList";
  public static final String HOME_CALENDAR_MEETING_LIST= "alertCalendarMeetingList";
  public static final String HOME_SYSTEM_LOG_LIST = "alertSystemLogList";
  public static final String HOME_RECENTLY_ACCESS_LIST = "recentlyAccessList";
  public static final String HOME_WORKFLOW_TASK_LIST = "workflowTaskList";
  public static final String HOME_WORKFLOW_TRACKING_LIST = "workflowTrackingList";

  public static final String OBJECT_TYPE_CONTACT = "T";

  public static final String OBJECT_TYPE_PERSON  = "P";

  /** LDAP */
  public static final String LOGIN_METHOD_NTLM="NTLM";
  public static final String LOGIN_METHOD_PARADM="PARADM";
  public static final String LOGIN_METHOD_LDAP="LDAP";
  //public static final String LOGIN_METHOD_BOTH="both";

  /****************************************************************************
   * The constant name for quartz job scheduler, used for TRIGGER_NAME and JOB_NAME
   ****************************************************************************/
  public final static String JOB_PREFIX_WORKFLOW_DEFAULT = "W_"; //  W_{timestamp}
  public final static String JOB_PREFIX_WORKFLOW_AUTO = "W_A_"; //  W_A_{progressID}
  public final static String JOB_PREFIX_WORKFLOW_NORESPONSE = "W_R_"; //  W_R_{progressID}
  public final static String JOB_PREFIX_WORKFLOW_SCHEDULE = "W_S_"; //  W_S_{scheduleID}
  public final static String JOB_PREFIX_WORKFLOW_PRIORITY = "W_P_"; //  W_P_{ruleType}_{ruleID}
  public final static String JOB_PREFIX_WORKFLOW_NOTIFY = "W_N_"; //  W_N_{triggerType}_{progressID}_{notificationRuleID}
  public final static String JOB_PREFIX_WORKFLOW_INTERRUPT = "W_I_"; //  W_I_{interruptType}_{trackID}_{progressID}

  public final static String DOCUMENT_INVITATION_JOB_GROUP = "D_I_G";// document invitation job group
  public final static String DOCUMENT_INVITATION_JOB_NAME = "D_I_";//D_I_(updateAlertID)
  
  public final static String JOB_PREFIX_DMS_ARCHIVE = "D_A_"; //  D_A_{archiveName}_{timestamp}
  public final static String JOB_PREFIX_DMS_CLEAR_CACHE = "DMS_CLEAR_CACHE_";
  
  public final static String PERSONAL_HOME = "Personal Home";
  
  /** The separator for the many file's name */
  public static final String FILENAME_SEPARATOR = "|";
  
  /** Constant for MagicTextBox 
   * if you want to change the value of MAX_LENGTH & DEFAULT_LENGTH
   * please change the javascript function areaToBox() in the "framework.js" at same time.
   */
  public static final String MAX_LENGTH = "26";
  public static final String DEFAULT_LENGTH = "20";
  
  public static final String TABLE_MINIMUM_HEIGHT = "300";
  
  public static final String REGEX_DBC_CASE = "[\\x00-\\u00FF]";
  public static final String REGEX_SBC_CASE = "[\\u0100-\\uFFFF]";
  public static final String REGEX_ZH_CN_CHAR = "[\\u4E00-\\u9FA5]";
  public static final String REGEX_SBC_CASE_CHAR = "[\\uFF00-\\uFFFF]";
}
